#ifndef SETTINGFUNC_H
#define SETTINGFUNC_H
//设置界面类，供mainWindow调用

#include <QWidget>
#include <QVector>

#include "videoconfigwidget.h"
#include "common.h"
#include "localsetting.h"
#include "myconfig.h"
#include "savesettings.h"

namespace Ui {
class SettingFunc;
}

class SettingFunc : public QWidget
{
    Q_OBJECT

public:
    explicit SettingFunc(QWidget *parent = nullptr);
    ~SettingFunc();

    void configSettings(const QVector<WINDOW_CONFIG> config);  //读取参数配置

    SettingsData getSettingsData()const;     //获取配置存储对象

    void loadVideoMode();

    void saveVideoMode();

    void changedVideoMode(int displayerID, int index);

    void showIPInfo(int i, int videoID, QString ipSrc);  //显示器，视频编号，ip源, 显示ip源

    void showSolution(int i, int videoID, int width, int height);

    void showFPS(int i, int videoID, int fps);

    void showEncodeForm(int i, int videoID, QString form);

signals:
    //param:显示器编号，视频编号，视频源名称，ip， 端口
    void sigVideoChanged(int displayerID, WINDOW_CONFIG m_sendConfig);
    void sigSetClick(int, int);
    void sigChangeDisplayMode(int, int);
    void sigSettingsData(const SettingsData& settingsData); //从存储设置界面传到存储设置后端（savedata/maincontrol）

private:
    VideoConfigWidget *m_configPanel_1;
    VideoConfigWidget *m_configPanel_2;
    VideoConfigWidget *m_configPanel_3;
    VideoConfigWidget *m_configPanel_4;
    QVector<VideoConfigWidget*> m_configPanels;
    LoadQss m_loadQss;  //自定义加载qss类
    LocalSetting *m_localSetting; //本地配置界面
    SaveSettings *m_saveSettings;    //存储参数设置界面
    int m_videoMode[4] = {0};

    Ui::SettingFunc *ui;
};

#endif // SETTINGFUNC_H
